package com.cheng.example.atguigu.design_pattern.command;

/*
 * @author 程帅
 * @createTime: 2020/10/19 9:27
 * @Created: with IntelliJ IDEA.
 */
public class TVOnCommand implements Command {

    //聚合TVReceiver
    TVReceiver tvReceiver;

    public TVOnCommand(TVReceiver tvReceiver) {
        this.tvReceiver = tvReceiver;
    }

    @Override
    public void execute() {
       tvReceiver.on();
    }

    @Override
    public void undo() {
        tvReceiver.off();
    }
}
